<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3" xmlns:head="http://www.w3.org/1999/html">
<head th:include="public/public_css::public_css ('出库发运管理')"/>

<body style="background-color: #f2f2f2;">
<div class="layui-fluid larry-wrapper">
    <div class="layui-card">
        <div class="layui-row layui-col-space30">
            <div class="layui-col-xs24">
                <form class="layui-form layui-card-header  layui-card-header-auto" id="searchForm">
                    <div class="layui-inline">
                        <label class="layui-form-label">波次编号</label>
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input" id="bcbh" name="bcbh" placeholder="波次编号"/>
                        </div>
                    </div>

                    <div class="layui-inline">
                        <label class="layui-form-label">发运单号</label>
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input" id="fybh" name="fybh" placeholder="发运单号"/>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">客户订单号</label>
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input" id="khddh" name="khddh" placeholder="客户订单号"/>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">装车单编号</label>
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input" id="zcdbh" name="zcdbh" placeholder="装车单编号"/>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">客户编号</label>
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input" id="khbh" name="khbh" placeholder="客户编号"/>
                        </div>
                    </div>
                    <div class="layui-inline inline-search-btn">
                        <a class="layui-btn layui-btn-normal" data-type="reload">查询</a>
                    </div>
                    <div class="moreSearch" style="display: none">

                        <div class="layui-inline">
                            <label class="layui-form-label">路线名称</label>
                            <div class="layui-input-inline">
                                <input type="text" class="layui-input" id="xl" name="xl" placeholder="路线名称"/>
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label">客户名称</label>
                            <div class="layui-input-inline">
                                <input type="text" class="layui-input" id="khmc" name="khmc" placeholder="客户名称"/>
                            </div>
                        </div>

                        <div class="layui-inline">
                            <label class="layui-form-label">交货时间</label>
                            <div class="layui-input-inline" id="qqs">
                                <input type="text" class="layui-input" id="yqjhsj" name="yqjhsj" placeholder="请选择时间范围" />
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label">创建时间</label>
                            <div class="layui-input-inline" id="qq">
                                <input type="text" class="layui-input" id="cjsj" name="cjsj" placeholder="请选择时间范围" />
                            </div>
                        </div>

                        <div class="layui-inline">
                            <label class="layui-form-label">收货地址</label>
                            <div class="layui-input-inline">
                                <input type="text" class="layui-input" id="khdz" name="khdz" placeholder="收货地址"/>
                            </div>
                        </div>
                    </div>
                    <input type="hidden" id="cjsj_start" name="cjsj_start">
                    <input type="hidden" id="cjsj_end" name="cjsj_end">
                    <input type="hidden" id="yqjhsj_end" name="yqjhsj_end">
                    <input type="hidden" id="yqjhsj_start" name="yqjhsj_start">
                </form>
                <div class="moreBtn"><i class="layui-icon layui-icon-triangle-d" style="color: #1E9FFF;"></i></div>
                <!-- Single button -->
                <div class="group-button" id="toolbar">

                    <a class="layui-btn layui-btn-sm layui-btn-normal btn_Cjzcd">
                        <i class="layui-icon">&#x1005;</i> 多选创建装车单
                    </a>
                    <a class="layui-btn layui-btn-sm layui-btn-normal btn_print">
                        <i class="layui-icon">&#x1005;</i> 多选打印装车单
                    </a>
                    <a class="layui-btn layui-btn-sm layui-btn-normal btn_fayun">
                        <i class="layui-icon">&#x1005;</i> 多选发运
                    </a>

                </div>

                <section class="panel panel-padding layui-card-body">
                    <div class="pro">
                        <table id="table" class="table text-nowrap"></table>
                    </div>
                </section>

            </div>
        </div>
    </div>
</div>

</body>


<div th:include="public/public_js::public_js"></div>
<style type="text/css">
    .moreBtn {
        width: 50px;
        height: 20px;
        text-align: center;
        color: #fff;
        line-height: 20px;
        background-color: #eee;
        position: relative;
        margin: 0 auto;
        cursor: pointer;
    }

    .moreBtn:before {
        content: '';
        display: block;
        width: 35px;
        height: 20px;
        position: absolute;
        transform: skewX(30deg);
        background: #eee;
        border-top-left-radius: 8px;
        left: -20px;
        top: 0;
    }

    .moreBtn:after {
        content: '';
        display: block;
        width: 35px;
        height: 20px;
        position: absolute;
        transform: skewX(-30deg);
        background: #eee;
        border-top-right-radius: 8px;
        top: 0;
        right: -20px;
    }
</style>
<script>

    $(function () {
        $(".moreBtn").on("click",function () {
            $(".moreSearch").toggle();
        })
    });
    layui.use(['list', 'layer', 'zzpUtils', 'jquery', 'laydate'], function () {
        window.operateEvent = {
            "click .layui-btn-primary": function (e, value, row, index) {
                /*这里激活状态那个按钮用不到，啥都不需要写，只读*/
            },
            "click #fy": function (e, value, row, index) {//行发运
                fy(row.id);
            },
            "click #creat": function (e, value, row, index) {//行创建装车单
                creat(row.id);
            },
            "click #xiafa": function (e, value, row, index) {//行下发装车单
                xiafa(row.id);
            },
            "click #print": function (e, value, row, index) {//行打印装车单
                print(row.id);
            }
        }
        var zzpUtils = layui.zzpUtils,
            $ = layui.jquery,
            laydate = layui.laydate;

        //交货时间
        laydate.render({
            elem: '#yqjhsj',
            type: 'date',
            range: '~',
            done: function(value, date, endDate){
                if(value!=null && value!=""){
                    var start=value.toString().substring(0,value.toString().indexOf("~"));
                    var end=value.toString().substring(value.toString().indexOf("~")+1);
                    $("#yqjhsj_start").val(Date.parse(new Date(start)));
                    $("#yqjhsj_end").val(Date.parse(new Date(end)));
                }else {
                    $("#yqjhsj_start").val("");
                    $("#yqjhsj_end").val("");
                }

                console.log(value); //得到日期生成的值，如：2017-08-18
                console.log(date); //得到日期时间对象：{year: 2017, month: 8, date: 18, hours: 0, minutes: 0, seconds: 0}
                console.log(endDate); //得结束的日期时间对象，开启范围选择（range: true）才会返回。对象成员同上。
            }
        });

        //创建时间开始
        laydate.render({
            elem: '#cjsj',
            type: 'date',
            range: '~',
            done: function(value, date, endDate){
                if(value!=null && value!=""){
                    var start=value.toString().substring(0,value.toString().indexOf("~"));
                    var end=value.toString().substring(value.toString().indexOf("~")+1);
                    $("#cjsj_start").val(Date.parse(new Date(start)));
                    $("#cjsj_end").val(Date.parse(new Date(end)));
                }else {
                    $("#cjsj_start").val("");
                    $("#cjsj_end").val("");
                }

                console.log(value); //得到日期生成的值，如：2017-08-18
                console.log(date); //得到日期时间对象：{year: 2017, month: 8, date: 18, hours: 0, minutes: 0, seconds: 0}
                console.log(endDate); //得结束的日期时间对象，开启范围选择（range: true）才会返回。对象成员同上。
            }
        });
        var $table = zzpUtils.table({
            elem: '#table',
            isApi: true,
            pagination: true,
            url: '/wmsloading/list',
            columns: [{
                field: '',
                checkbox: true
            },{
                field: 'khcjsj',
                title: '客户创建时间'
            }, {
                field: 'cjsj',
                title: 'Wms创建时间'
            }, {
                field: 'fybh',
                title: 'SO编号'
            }, {
                field: 'khddh',
                title: '客户订单号'
            }, {
                field: 'zcdbh',
                title: '装车单编号'
            }, {
                field: 'show_fylx',
                title: '订单类型'
            }, {
                field: 'show_fyzt',
                title: 'SO状态'
            }, {
                field: 'show_jhzt',
                title: '拣货状态'
            }, {
                field: 'show_zxzt',
                title: '装箱状态'
            }, {
                field: 'caozuo',
                title: '操作',
                events: operateEvent,
                formatter:operateFormatter
            }],
            queryParams: function () {//查询条件
                return zzpUtils.getFormJson($("#searchForm"));
            },
            detailFormatter: function (index, row) {
                return "这里就没有确定过11";
            }
        });
        /*表格右侧按钮*/
        function operateFormatter(value, row, index) {
            if (row.zcdbh !='0'&&(row.fyzt =='3'||row.fyzt=='4')) {
                return [
                    '<a class="layui-btn layui-btn-normal layui-btn-xs layui-btn-disabled" id="fy">发运</a>',
                    '<a class="layui-btn layui-btn-normal layui-btn-xs" id="print">打印装车单</a>',
                    '<a class="layui-btn layui-btn-normal layui-btn-xs layui-btn-disabled" id="creat">创建装车单</a>',
                    '<a class="layui-btn layui-btn-normal layui-btn-xs layui-btn-disabled" id="xiafa">下发发运任务</a>'
                ].join('')
            } else if(row.zcdbh !='0'&&(row.fyzt !='3'||row.fyzt !='4')){
                return [
                    '<a class="layui-btn layui-btn-normal layui-btn-xs" id="fy">发运</a>',
                    '<a class="layui-btn layui-btn-normal layui-btn-xs" id="print">打印装车单</a>',
                    '<a class="layui-btn layui-btn-normal layui-btn-xs layui-btn-disabled" id="creat">创建装车单</a>',
                    '<a class="layui-btn layui-btn-normal layui-btn-xs" id="xiafa">下发发运任务</a>'
                ].join('')
            }else if(row.zcdbh =='0'&&(row.fyzt =='3'||row.fyzt=='4')){
                return [
                    '<a class="layui-btn layui-btn-normal layui-btn-xs layui-btn-disabled" id="fy">发运</a>',
                    '<a class="layui-btn layui-btn-normal layui-btn-xs layui-btn-disabled" id="print">打印装车单</a>',
                    '<a class="layui-btn layui-btn-normal layui-btn-xs" id="creat">创建装车单</a>',
                    '<a class="layui-btn layui-btn-normal layui-btn-xs layui-btn-disabled" id="xiafa">下发发运任务</a>'
                ].join('')
            }else if(row.zcdbh =='0'&&(row.fyzt !='3'||row.fyzt !='4')){
                return [
                    '<a class="layui-btn layui-btn-normal layui-btn-xs" id="fy">发运</a>',
                    '<a class="layui-btn layui-btn-normal layui-btn-xs layui-btn-disabled" id="print">打印装车单</a>',
                    '<a class="layui-btn layui-btn-normal layui-btn-xs" id="creat">创建装车单</a>',
                    '<a class="layui-btn layui-btn-normal layui-btn-xs" id="xiafa">下发发运任务</a>'
                ].join('')
            }

        }
        //查询
        $(".inline-search-btn").on('click', function () {
            zzpUtils.refreshTable("#table");
        })

        //打印装车单
        function print(id) {
            var ids = [];
            ids.push(id);
            zzpUtils.confirm("您将打印选择的装车单", function (index) {
                zzpUtils.action({
                    url: "/wmsloading/printLoading" ,
                    data: JSON.stringify({ids:ids}),
                    success: function (data) {
                        if(data.title=='打印装车单失败'){
                            setTimeout(function () {
                                layer.msg(data.message);
                            }, 500);
                        }else{
                            var LODOP=getLodop();
                            for(var i=0;i<data.rows.length;i++){
                                LODOP.ADD_PRINT_TEXT(51, 261, 268, 42, '大连双迪发运装载单');
                                LODOP.SET_PRINT_STYLEA(0, 'FontSize', 20);
                                LODOP.SET_PRINT_STYLEA(0, 'Horient', 2);
                                LODOP.ADD_PRINT_BARCODE(120, 230, 400, 78, 'EAN128B', data.rows[i].zcdbh);
                                LODOP.SET_PRINT_STYLEA(0, 'Horient', 2);
                                LODOP.ADD_PRINT_TEXT(235, 123, 160, 24, '物流单数');
                                LODOP.ADD_PRINT_TEXT(235, 188, 160, 24, data.rows[i].zds);
                                LODOP.SET_PRINT_STYLEA(0, 'FontSize', 11);
                                LODOP.ADD_PRINT_TEXT(286, 123, 160, 25, '承运商');
                                LODOP.ADD_PRINT_TEXT(286, 188, 160, 25, data.rows[i].cyrmc);
                                LODOP.SET_PRINT_STYLEA(0, 'FontSize', 11);
                                LODOP.ADD_PRINT_TEXT(233, 327, 252, 25, '总箱数');
                                LODOP.ADD_PRINT_TEXT(233, 392, 252, 25, data.rows[i].zxs);
                                LODOP.SET_PRINT_STYLEA(0, 'FontSize', 11);
                                LODOP.ADD_PRINT_TEXT(285, 325, 254, 25, '承运车辆');
                                LODOP.ADD_PRINT_TEXT(282, 390, 254, 25, data.rows[i].cycl);
                                LODOP.SET_PRINT_STYLEA(0, 'FontSize', 11);
                                var trs='';
                                for(var j=0;j<data.rows[i].wmsLoadingDetailedList.length;j++){
                                    trs+='<tr>\n' +
                                        '                    <td width="50px"  style="border: 1px solid #000;height:18px"><b>'+(j+1)+'</b></td>\n' +
                                        '                    <td width="180px" style="border: 1px solid #000;height:18px"><b>'+data.rows[i].wmsLoadingDetailedList[j].wlbh+'</b></td>\n' +
                                        '                    <td width="180px" style="border: 1px solid #000;height:18px"><b>'+data.rows[i].wmsLoadingDetailedList[j].xbh+'</b></td>\n' +
                                        '                    <td width="180px" style="border: 1px solid #000;height:18px"><b>'+data.rows[i].wmsLoadingDetailedList[j].shr+'</b></td>\n' +
                                        '                  </tr>';
                                }
                                LODOP.ADD_PRINT_TABLE(334, 125, 500, 280,'<table border=0 cellSpacing=0 cellPadding=0  width="100%">\n' +
                                    '                  <tr>\n' +
                                    '                    <td width="50px"  style="border: 1px solid #000;height:18px"><b>序号</b></td>\n' +
                                    '                    <td width="180px" style="border: 1px solid #000;height:18px"><b>物流单号</b></td>\n' +
                                    '                    <td width="180px" style="border: 1px solid #000;height:18px"><b>箱编号</b></td>\n' +
                                    '                    <td width="180px" style="border: 1px solid #000;height:18px"><b>收货人</b></td>\n' +
                                    '\n' +
                                    '                  </tr>'+ trs+'<tfoot>\n' +
                                '                  <tr>\n' +
                                '                  <th colspan="2" style="border: none; height: 50px">双迪代表</th>\n' +
                                '                  <th colspan="2" style="border: none; height: 50px">承运人</th>\n' +
                                '                  </tr>\n' +
                                '                   <tr>\n' +
                                '                  <th colspan="2" style="border: none; height: 50px">日期</th>\n' +
                                '                  <th colspan="2" style="border: none; height: 50px">日期</th>\n' +
                                '                  </tr>\n' +
                                '\n' +
                                '                  </tfoot></table>');
                                LODOP.ADD_PRINT_TEXT(233, 599, 169, 25, '打印日期');
                                var date=new Date();
                                LODOP.ADD_PRINT_TEXT(230, 660, 169, 25,date.getFullYear()+'-0'+(date.getMonth() + 1)+'-'+date.getDate());
                                LODOP.SET_PRINT_STYLEA(0, 'FontSize', 11);
                                if(i>=0){
                                    LODOP.NewPage();//分页
                                }
                                }
                            }
                            LODOP.PREVIEW();

                    }, error: function (xhr, textStatus) {
                        console.log(textStatus);
                        console.log(xhr)
                    }
                })
            })
            return false;

        }
        /*多选打印装车单*/
        $(".btn_print").on('click', function () {
            var $rows = $table.bootstrapTable('getSelections');
            if ($rows.length == 0) {
                layer.msg("请选择一条进行创建");
            } else {
                var ids = $.map($rows, function (row) {
                    return row.id;
                });
                zzpUtils.confirm("您将打印选择的装车单", function (index) {
                    zzpUtils.action({
                        url: "/wmsloading/printLoading" ,
                        data: JSON.stringify({ids:ids}),
                        success: function (data) {
                            if(data.title=='打印装车单失败'){
                                setTimeout(function () {
                                    layer.msg(data.message);
                                }, 500);
                            }else{
                                var LODOP=getLodop();
                                LODOP.PRINT_INIT('打印装车单信息');
                                for(var i=0;i<data.rows.length;i++){
                                    LODOP.ADD_PRINT_TEXT(51, 261, 268, 42, '大连双迪发运装载单');
                                    LODOP.SET_PRINT_STYLEA(0, 'FontSize', 20);
                                    LODOP.SET_PRINT_STYLEA(0, 'Horient', 2);
                                    LODOP.ADD_PRINT_BARCODE(120, 230, 400, 78, 'EAN128B', data.rows[i].zcdbh);
                                    LODOP.SET_PRINT_STYLEA(0, 'Horient', 2);
                                    LODOP.ADD_PRINT_TEXT(235, 123, 160, 24, '物流单数');
                                    LODOP.ADD_PRINT_TEXT(235, 188, 160, 24, data.rows[i].zds);
                                    LODOP.SET_PRINT_STYLEA(0, 'FontSize', 11);
                                    LODOP.ADD_PRINT_TEXT(286, 123, 160, 25, '承运商');
                                    LODOP.ADD_PRINT_TEXT(286, 188, 160, 25, data.rows[i].cyrmc);
                                    LODOP.SET_PRINT_STYLEA(0, 'FontSize', 11);
                                    LODOP.ADD_PRINT_TEXT(233, 327, 252, 25, '总箱数');
                                    LODOP.ADD_PRINT_TEXT(233, 392, 252, 25, data.rows[i].zxs);
                                    LODOP.SET_PRINT_STYLEA(0, 'FontSize', 11);
                                    LODOP.ADD_PRINT_TEXT(285, 325, 254, 25, '承运车辆');
                                    LODOP.ADD_PRINT_TEXT(282, 390, 254, 25, data.rows[i].cycl);
                                    LODOP.SET_PRINT_STYLEA(0, 'FontSize', 11);
                                    var trs='';
                                    for(var j=0;j<data.rows[i].wmsLoadingDetailedList.length;j++){
                                        trs+='<tr>\n' +
                                            '                    <td width="50px"  style="border: 1px solid #000;height:18px"><b>'+(j+1)+'</b></td>\n' +
                                            '                    <td width="180px" style="border: 1px solid #000;height:18px"><b>'+data.rows[i].wmsLoadingDetailedList[j].wlbh+'</b></td>\n' +
                                            '                    <td width="180px" style="border: 1px solid #000;height:18px"><b>'+data.rows[i].wmsLoadingDetailedList[j].xbh+'</b></td>\n' +
                                            '                    <td width="180px" style="border: 1px solid #000;height:18px"><b>'+data.rows[i].wmsLoadingDetailedList[j].shr+'</b></td>\n' +
                                            '                  </tr>';
                                    }
                                    LODOP.ADD_PRINT_TABLE(334, 125, 500, 280,'<table border=0 cellSpacing=0 cellPadding=0  width="100%">\n' +
                                        '                  <tr>\n' +
                                        '                    <td width="50px"  style="border: 1px solid #000;height:18px"><b>序号</b></td>\n' +
                                        '                    <td width="180px" style="border: 1px solid #000;height:18px"><b>物流单号</b></td>\n' +
                                        '                    <td width="180px" style="border: 1px solid #000;height:18px"><b>箱编号</b></td>\n' +
                                        '                    <td width="180px" style="border: 1px solid #000;height:18px"><b>收货人</b></td>\n' +
                                        '\n' +
                                        '                  </tr>'+ trs+'<tfoot>\n' +
                                        '                  <tr>\n' +
                                        '                  <th colspan="2" style="border: none; height: 50px">双迪代表</th>\n' +
                                        '                  <th colspan="2" style="border: none; height: 50px">承运人</th>\n' +
                                        '                  </tr>\n' +
                                        '                   <tr>\n' +
                                        '                  <th colspan="2" style="border: none; height: 50px">日期</th>\n' +
                                        '                  <th colspan="2" style="border: none; height: 50px">日期</th>\n' +
                                        '                  </tr>\n' +
                                        '\n' +
                                        '                  </tfoot></table>');
                                    LODOP.ADD_PRINT_TEXT(233, 599, 169, 25, '打印日期');
                                    var date=new Date();
                                    LODOP.ADD_PRINT_TEXT(230, 660, 169, 25,date.getFullYear()+'-0'+(date.getMonth() + 1)+'-'+date.getDate());
                                    LODOP.SET_PRINT_STYLEA(0, 'FontSize', 11);
                                    if(i>=0){
                                        LODOP.NewPage();//分页
                                    }
                                }
                            }
                            LODOP.PREVIEW();
                        }, error: function (xhr, textStatus) {
                            console.log(textStatus);
                            console.log(xhr)
                        }
                    })
                })
            }

        })
        //下发发运任务
        function xiafa(id) {
            zzpUtils.dialog({
                title: "下发发运任务",
                type: 2,
                content: "/outOperation/lowerTask?ids="+id,
                area: ['50%', '40%'], //设置dialog大小，也可以不设置，
                end: function () {//增加成功后刷新
                    zzpUtils.refreshTable("#table");
                }
            });
        }
        //创建装车单
        function creat(id) {
            zzpUtils.dialog({
                title: "选择承运人",
                type: 2,
                content: "/outOperation/creat?ids="+id,
                area: ['48%', '40%'], //设置dialog大小，也可以不设置，
                end: function () {//增加成功后刷新
                    zzpUtils.refreshTable("#table");
                }
            });
        }
        /*多选创建装车单*/
        $(".btn_Cjzcd").on('click', function () {
            var $rows = $table.bootstrapTable('getSelections');
            if ($rows.length == 0) {
                layer.msg("请选择一条进行创建");
            } else {
                var ids = $.map($rows, function (row) {
                    return row.id;
                });
                zzpUtils.dialog({
                    title: "选择承运人",
                    type: 2,
                    content: "/outOperation/creat?ids="+ids,
                    area: ['48%', '30%'], //设置dialog大小，也可以不设置，
                    end: function () {//增加成功后刷新
                        zzpUtils.refreshTable("#table");
                    }
                });
            }

        })
        //发运
        function fy(id) {
            var ids = [];
            ids.push(id);
            $.ajax({
                url: '/zxsswms/wmspicking/dataJudgment',
                type: 'POST',
                dataType: 'json',
                contentType: 'application/json',
                data: JSON.stringify({ids:ids}),
                success: function (data) {
                    var string="";
                    if(data==2){
                        string="您将发运选择的发运订单";
                    }else{
                        string="您有未拣货的数据，是否确认继续发运";
                    }
                    zzpUtils.confirm(string, function (index) {
                        zzpUtils.action({
                            url: "/wmspicking/despacth" ,
                            data: JSON.stringify({ids:ids}),
                            success: function (data) {
                                setTimeout(function () {
                                    layer.msg(data.title+data.message);
                                }, 500);
                                zzpUtils.refreshTable("#table");
                            }, error: function (xhr, textStatus) {
                                console.log(textStatus);
                                console.log(xhr)
                            }
                        })
                    })
                },
                error: function () { console.log("Error"); }
            })

            return false;

        }
        /*顶部按钮多选发运*/
        $(".btn_fayun").on('click', function () {
            var index = 0;
            var $rows = $table.bootstrapTable('getSelections');
            //判断选中是否有已发运
            for (var i = 0; i < $rows.length; i++) {
                if ($rows[i].fyzt == 3||$rows[i].fyzt == 4) {
                    index++;
                }
            }
            if (index > 0) {
                layer.msg("您选择的订单有已发运完成的，请重选！");
            }
            if ($rows.length == 0) {
                layer.msg("请选择一条数据进行发运");
            } else {
                var ids = $.map($rows, function (row) {
                    return row.id;
                })
                $.ajax({
                    url: '/zxsswms/wmspicking/dataJudgment',
                    type: 'POST',
                    dataType: 'json',
                    contentType: 'application/json',
                    data: JSON.stringify({ids:ids}),
                    success: function (data) {
                        var string="";
                        if(data==2){
                            string="您将发运选择的发运订单";
                        }else{
                            string="您有未拣货的数据，是否确认继续发运";
                        }
                        zzpUtils.confirm(string, function (index) {
                            zzpUtils.action({
                                url: "/wmspicking/despacth" ,
                                data: JSON.stringify({ids:ids}),
                                success: function (data) {
                                    setTimeout(function () {
                                        layer.msg(data.title+data.message);
                                    }, 500);
                                    zzpUtils.refreshTable("#table");
                                }, error: function (xhr, textStatus) {
                                    console.log(textStatus);
                                    console.log(xhr)
                                }
                            })
                        })
                    },
                    error: function () { console.log("Error"); }
                })
                return false;
            }
        })
    });

</script>
</html>